// 巡修计划
import request from "@/api/request";
//   headers: { "Content-Type": "application/json;charset=UTF-8" },

// 单别
export const category_CategoryList = (params) => {
  return request({
    url: "/planmanage/mp/orderCategoryList/" + params,
    method: "post",
  });
};

// 分页查询巡修计划单
export const query_patrolPlan = (params) => {
  return request({
    url: "/planmanage/rp/selectAll",
    method: "post",
    data: params,
  });
};

// 新增巡修计划
export const add_patrolPlan = (params) => {
  return request({
    url: "/planmanage/rp/insert",
    method: "post",
    data: params,
    headers: { "Content-Type": "application/json;charset=UTF-8" },
  });
};

// 查询巡修计划详情
export const select_patrolPlans = (params) => {
  return request({
    url: `/planmanage/rp/selectDetails/${params}`,
    method: "post",
    data: params,
  });
};

// 修改巡修计划
export const update_patrolPlans = (params) => {
  return request({
    url: "/planmanage/rp/update",
    method: "post",
    data: params,
    headers: { "Content-Type": "application/json;charset=UTF-8" },
  });
};

// 逻辑删除巡修计划
export const delete_patrolPlans = (params) => {
  return request({
    url: `/planmanage/rp/delete/${params}`,
    method: "post",
    data: params,
  });
};

// 提交
export const commit_patrolPlans = (params) => {
  return request({
    url: "/planmanage/rp/commit",
    method: "post",
    data: params,
    headers: { "Content-Type": "application/json;charset=UTF-8" },
  });
};

// 审核
export const audit_patrolPlans = (params) => {
  return request({
    url: "/planmanage/rp/audit",
    method: "post",
    data: params,
    headers: { "Content-Type": "application/json;charset=UTF-8" },
  });
};

// 审核历史
export const history_patrolPlans = (params) => {
  return request({
    url: "/planmanage/rp/getAuditHistory",
    method: "post",
    data: params,
  });
};

// 回退
export const undo_patrolPlans = (params) => {
  return request({
    url: "/planmanage/rp/undo",
    method: "post",
    data: params,
  });
};

// 作废
export const cancel_patrolPlans = (params) => {
  return request({
    url: "/planmanage/rp/cancel",
    method: "post",
    data: params,
  });
};

// 查询单位列表
export const org_data = () => {
  return request({
    url: "/planmanage/mp/orgList",
    method: "post",
    headers: { "Content-Type": "application/json;charset=UTF-8" },
  });
};

// 查询人员列表
export const user_data = (params) => {
  return request({
    url: "/planmanage/mp/userList/" + params,
    method: "post",
    headers: { "Content-Type": "application/json;charset=UTF-8" },
  });
};

// 等级
export const upkeep_grade = (params) => {
  return request({
    url: "/planmanage/mp/patrolsRepairsLevelList",
    method: "post",
    data: params,
  });
};

// 删除子表
export const delete_son = (params) => {
  return request({
    url: "/planmanage/pmp/delete/" + params,
    method: "post",
    data: params,
    headers: { "Content-Type": "application/json;charset=UTF-8" },
  });
};
